package com.xbang.attendance.entity.order;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.xbang.attendance.entity.product.Product;
import com.xbang.attendance.entity.system.Warehouse;
import com.xbang.core.dao.entity.BaseEntity;


public class StockOutLog  extends BaseEntity implements Serializable{
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;
	
	/** PO */
	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, targetEntity = PurchaseOrder.class, fetch = FetchType.LAZY)
	@JoinColumn(name = "purchase_order", referencedColumnName = "id")
	private PurchaseOrder purchaseOrder;
	
	/** 送货单 */
	@ManyToOne(cascade = { CascadeType.MERGE, CascadeType.PERSIST }, fetch = FetchType.LAZY, targetEntity = DeliveryOrder.class)
	@JoinColumn(columnDefinition = "delivery_order", referencedColumnName = "id")
	private DeliveryOrder deliveryOrder;

	/** 产品 */
	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY, targetEntity = Product.class)
	@JoinColumn(columnDefinition = "product", referencedColumnName = "id")
	private Product product;
	
	/** 配件数量 */
	private BigDecimal number;
	
	
	/** 仓储商 */
	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY, targetEntity = Warehouse.class)
	@JoinColumn(columnDefinition = "warehouse", referencedColumnName = "id")
	private Warehouse warehouse;
	
	private Date date;

	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public PurchaseOrder getPurchaseOrder() {
		return purchaseOrder;
	}


	public void setPurchaseOrder(PurchaseOrder purchaseOrder) {
		this.purchaseOrder = purchaseOrder;
	}


	public DeliveryOrder getDeliveryOrder() {
		return deliveryOrder;
	}


	public void setDeliveryOrder(DeliveryOrder deliveryOrder) {
		this.deliveryOrder = deliveryOrder;
	}


	public Product getProduct() {
		return product;
	}


	public void setProduct(Product product) {
		this.product = product;
	}



	public BigDecimal getNumber() {
		return number;
	}


	public void setNumber(BigDecimal number) {
		this.number = number;
	}


	public Warehouse getWarehouse() {
		return warehouse;
	}


	public void setWarehouse(Warehouse warehouse) {
		this.warehouse = warehouse;
	}


	public Date getDate() {
		return date;
	}


	public void setDate(Date date) {
		this.date = date;
	}
	
	
	
}
